# -*- coding: utf-8 -*-
"""
@Time    : 2024/7/3 19:31 
@Author  : ZhangShenao 
@File    : basic.py 
@Desc    : 输入输出基础
"""


def print_welcome():
    """输出欢迎信息"""

    # 使用input()函数接收输入,返回类型为str
    name = input('your name: \n')
    gender = input('are you a boy? (y/n)\n')
    welcome_str = 'Welcome to the world of Python, {prefix} {name} !'
    prefix = 'Mr.' if 'y' == gender else 'Miss.'
    print(welcome_str.format(prefix=prefix, name=name))


def print_sum():
    """输入两个数并输出它们的和"""

    # 因为input()函数返回的是str类型,所以需要转换为int类型
    a = int(input('first number: \n'))
    b = int(input('second number: \n'))
    print(f'sum is {a + b}')


if __name__ == '__main__':
    print_welcome()

    print_sum()
